# 生成完整字体集

import torch
from svg_utils import commands_to_svg

def generate_font(model, style_image, chars_to_generate):
    model.eval()
    with torch.no_grad():
        style_feat = model.style_encoder(style_image)
        svg_commands = model.decoder.generate(style_feat, max_length=500)
    return {
        char: commands_to_svg(commands)
        for char, commands in zip(chars_to_generate, svg_commands)
    }
